<!DOCTYPE html>
<html ng-app >
    <head>
        <title>Upload Log Table</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
        <script type="text/javascript" src ="uploadlog.js"></script>
        <script type="text/javascript" src ="uploadlogdata.php"></script>
         <!--<style type="text/css">
            table
            {
                border: 1px solid #000;
            }
        </style> -->
        
    </head>
    
    <body ng-app="main" ng-controller="logdata">
    
    <?php  
       include('top.php'); 
    ?>
    
     <!--  <div>Search:
            <input type="text" ng-model="search"> -->
       
            
      <!--      
        <div id="ng-app" ng-app ng-controller="logdata">
            <table>
                <tr>
                    <th>Travel Date</th>
                    <th>Passenger Name</th>
                    <th>Basic</th>
                    <th>Total</th>
                    <th>Upload Result</th>  
                  </tr>
          
          
              <tr ng-repeat="logdata in data">
                    <td>{{logdata.Date}}</td>
                    <td>{{logdata.Name}}</td>
                    <td>{{logdata.Basic}}</td>
                    <td>{{logdata.Total}}</td>
                    <td>{{logdata.Result}}</td>
                  </tr>
            </table> 
            <ul>
            <li ng-repeat="logdata in data">
            {{logdata.Date}} - {{logdata.Name}} - {{logdata.Basic}} - {{logdata.Total}} -  {{logdata.Result}}
            </li>
            </ul>
        </div>
    </div>     -->
   <body ng-app="main">
    <div ng-controller="loadata">
        <p><strong>Page:</strong> {{tableParams.page()}}</p>
        <p><strong>Count per page:</strong> {{tableParams.count()}}</p>
        
        <table ng-table="tableParams" class="table">
        <tr ng-repeat="loaddata in $data">
            <td data-title="'Name'">{{loaddata.name}}</td>
            <td data-title="'Age'">{{loaddata.age}}</td>
        </tr>
        </table>
    </div>
</body>
                
                
   <?php
           include('conn.php');
           
            $qry1 = "SELECT * from csvtable";
            $qry = mysql_query($qry1);
            $data = array();
                $i=1;
            while($rows = mysql_fetch_array($qry))
        {
            $data[] = array("Date" => $rows['Bkng_Date'],
                "Name"=> $rows['PaxName'],                  
                "Basic" => $rows['Basic'],
                "Total" => $rows['Net_Payable'],
                "Result" => $rows['processed']  );
        }
      echo json_encode($data);
    ?>   
 
      
     <script language="javascript">
        
         function logdata($scope, $http)
         $scope.url = 'uploadlogdata.php'; 
     {
            $http.post($scope.url, 
            { // Values you with to send to php page
                "Basic": $scope.Basic, "Result": $scope.processed
            }).success(function(data, status) {
    
                // Values returned from php handler will be in data
                $scope.status = status;
                $scope.data = data;
                $scope.result = data; // Show result from server in our <pre></pre> element
            }).error(function(data, status) {
                    $scope.data = data || "Request failed";
                    $scope.status = status; 
            });    
        }
 </script> 
            
           
    </body>
</html>












